package com.qianguo.buyer.entity;


import android.os.Parcel;
import android.os.Parcelable;

import com.alibaba.fastjson.annotation.JSONField;
import com.eva.androidlibrary.api.entity.BaseBean;

/**
 * @author guxun
 * @date 16/6/28
 */
public class ShopCarItem extends BaseBean implements Parcelable {
    /**
     * 购物车id
     */
    @JSONField(name = "cartid")
    private int cartid;
    /**
     * 用户id
     */
    @JSONField(name = "uuid")
    private String uuid;
    /**
     * 店铺id
     */
    @JSONField(name = "shopid")
    private String shopid;
    /**
     * 要购买的商品数量
     */
    @JSONField(name = "num")
    private int num;
    /**
     * 0, 是否选中,0否,1是
     */
    @JSONField(name = "is_selected")
    private int is_selected;
    /**
     * 商品id
     */
    @JSONField(name = "productid")
    private String productid;
    /**
     * 单位
     */
    @JSONField(name = "unit")
    private String unit;
    /**
     * 售价
     */
    @JSONField(name = "price")
    private int price;

    public int getCartid() {
        return cartid;
    }

    public void setCartid(int cartid) {
        this.cartid = cartid;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getShopid() {
        return shopid;
    }

    public void setShopid(String shopid) {
        this.shopid = shopid;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public int getIs_selected() {
        return is_selected;
    }

    public void setIs_selected(int is_selected) {
        this.is_selected = is_selected;
    }

    public String getProductid() {
        return productid;
    }

    public void setProductid(String productid) {
        this.productid = productid;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public int getMarket_price() {
        return market_price;
    }

    public void setMarket_price(int market_price) {
        this.market_price = market_price;
    }

    public String getImg_url() {
        return img_url;
    }

    public void setImg_url(String img_url) {
        this.img_url = img_url;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 市场价
     */

    @JSONField(name = "market_price")
    private int market_price;
    /**
     * 图片url
     */
    @JSONField(name = "img_url")
    private String img_url;
    /**
     * 商品名称
     */
    @JSONField(name = "name")
    private String name;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.cartid);
        dest.writeString(this.uuid);
        dest.writeString(this.shopid);
        dest.writeInt(this.num);
        dest.writeInt(this.is_selected);
        dest.writeString(this.productid);
        dest.writeString(this.unit);
        dest.writeInt(this.price);
        dest.writeInt(this.market_price);
        dest.writeString(this.img_url);
        dest.writeString(this.name);
    }

    public ShopCarItem() {
    }

    protected ShopCarItem(Parcel in) {
        this.cartid = in.readInt();
        this.uuid = in.readString();
        this.shopid = in.readString();
        this.num = in.readInt();
        this.is_selected = in.readInt();
        this.productid = in.readString();
        this.unit = in.readString();
        this.price = in.readInt();
        this.market_price = in.readInt();
        this.img_url = in.readString();
        this.name = in.readString();
    }

    public static final Creator<ShopCarItem> CREATOR = new Creator<ShopCarItem>() {
        @Override
        public ShopCarItem createFromParcel(Parcel source) {
            return new ShopCarItem(source);
        }

        @Override
        public ShopCarItem[] newArray(int size) {
            return new ShopCarItem[size];
        }
    };
}
